// ml:run = $bin < input
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <algorithm>
#include <utility>
#include <map>
#include <set>

int sg[200];

int calc(int x)
{
    if (sg[x] != -1) return sg[x];
    std::set<int> mex;
    for (int i = 1; i < x; i++) {
        mex.insert(calc(i) ^ calc(x - i));
    }
    for (int i = 0; ; i++)
        if (!mex.count(i)) return sg[x] = i;
}

int main()
{
    for (int i = 0; i < 200; i++)
        sg[i] = -1;
    for (int i = 1; i < 200; i++) {
        sg[i] = calc(i);
        std::cout << i << "  " << sg[i] << "\n";
    }
}

